//////////////////////////////////////////////////////////////////////////
// FileName:
// CreateBy:
// CreateDate:2010/5/25
// Description:
//		SecurityTraining class
//
// Modify Log:
//
// Copyright:
/////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Auto.Components;

namespace Auto.Data.BusMan.Model
{
    [Serializable]
    public class SecurityTraining
    {
        #region --Field--
        ///<summary>
        ///Data Table Bus_SecurityTraining
        ///</summary>
        public const string TABLENAME_Bus_SecurityTraining="Bus_SecurityTraining";
        /// <sumary> 
        /// (RecID Type:Int Len:0) 
        /// </sumary> 
        public const string FIELD_RecID="RecID";
        /// <sumary> 
        /// (DocID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_DocID="DocID";
        /// <sumary> 
        /// (Year Type:Int Len:0) 
        /// </sumary> 
        public const string FIELD_Year="Year";
        /// <sumary> 
        /// (Item Type:NVarChar Len:50) 
        /// </sumary> 
        public const string FIELD_Item="Item";
        /// <sumary> 
        /// (TrainingContent Type:NVarChar Len:2000) 
        /// </sumary> 
        public const string FIELD_TrainingContent="TrainingContent";
        /// <sumary> 
        /// (StudyMaterial Type:NVarChar Len:100) 
        /// </sumary> 
        public const string FIELD_StudyMaterial="StudyMaterial";
        /// <sumary> 
        /// (TrainingResult Type:NVarChar Len:100) 
        /// </sumary> 
        public const string FIELD_TrainingResult="TrainingResult";
        /// <sumary> 
        /// (RecDivID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_RecDivID="RecDivID";
        /// <sumary> 
        /// (RecAcct Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_RecAcct="RecAcct";
        /// <sumary> 
        /// (RecDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public const string FIELD_RecDate="RecDate";
        /// <sumary> 
        /// (Void Type:Bit Len:0) 
        /// </sumary> 
        public const string FIELD_Void="Void";
        /// <sumary> 
        /// (VoidAcct Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_VoidAcct="VoidAcct";
        /// <sumary> 
        /// (VoidDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public const string FIELD_VoidDate="VoidDate";
        /// <sumary> 
        /// (UserAcct Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_UserAcct="UserAcct";
        /// <sumary> 
        /// (LastUpdateDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public const string FIELD_LastUpdateDate="LastUpdateDate";
        #endregion --Field--

        #region --Property--
        private int _recid;
        private string _docid;
        private int _year;
        private string _item;
        private string _trainingcontent;
        private string _studymaterial;
        private string _trainingresult;
        private string _recdivid;
        private string _recacct;
        private DateTime _recdate;
        private bool _void;
        private string _voidacct;
        private DateTime _voiddate;
        private string _useracct;
        private DateTime _lastupdatedate;

        /// <sumary> 
        /// (RecID Type:Int Len:0) 
        /// </sumary> 
        public int RecID
        {
            set { _recid = value; }
            get { return _recid; }
        }

        /// <sumary> 
        /// (DocID Type:VarChar Len:20) 
        /// </sumary> 
        public string DocID
        {
            set { _docid = value; }
            get { return _docid; }
        }

        /// <sumary> 
        /// (Year Type:Int Len:0) 
        /// </sumary> 
        public int Year
        {
            set { _year = value; }
            get { return _year; }
        }

        /// <sumary> 
        /// (Item Type:NVarChar Len:50) 
        /// </sumary> 
        public string Item
        {
            set { _item = value; }
            get { return _item; }
        }

        /// <sumary> 
        /// (TrainingContent Type:NText Len:1073741823) 
        /// </sumary> 
        public string TrainingContent
        {
            set { _trainingcontent = value; }
            get { return _trainingcontent; }
        }

        /// <sumary> 
        /// (StudyMaterial Type:NVarChar Len:100) 
        /// </sumary> 
        public string StudyMaterial
        {
            set { _studymaterial = value; }
            get { return _studymaterial; }
        }

        /// <sumary> 
        /// (TrainingResult Type:NVarChar Len:100) 
        /// </sumary> 
        public string TrainingResult
        {
            set { _trainingresult = value; }
            get { return _trainingresult; }
        }

        /// <sumary> 
        /// (RecDivID Type:VarChar Len:20) 
        /// </sumary> 
        public string RecDivID
        {
            set { _recdivid = value; }
            get { return _recdivid; }
        }

        /// <sumary> 
        /// (RecAcct Type:VarChar Len:20) 
        /// </sumary> 
        public string RecAcct
        {
            set { _recacct = value; }
            get { return _recacct; }
        }

        /// <sumary> 
        /// (RecDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public DateTime RecDate
        {
            set { _recdate = value; }
            get { return _recdate; }
        }

        /// <sumary> 
        /// (Void Type:Bit Len:0) 
        /// </sumary> 
        public bool Void
        {
            set { _void = value; }
            get { return _void; }
        }

        /// <sumary> 
        /// (VoidAcct Type:VarChar Len:20) 
        /// </sumary> 
        public string VoidAcct
        {
            set { _voidacct = value; }
            get { return _voidacct; }
        }

        /// <sumary> 
        /// (VoidDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public DateTime VoidDate
        {
            set { _voiddate = value; }
            get { return _voiddate; }
        }

        /// <sumary> 
        /// (UserAcct Type:VarChar Len:20) 
        /// </sumary> 
        public string UserAcct
        {
            set { _useracct = value; }
            get { return _useracct; }
        }

        /// <sumary> 
        /// (LastUpdateDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public DateTime LastUpdateDate
        {
            set { _lastupdatedate = value; }
            get { return _lastupdatedate; }
        }

        #endregion --Property--

        #region --New--
        /// <summary>
        /// Constructed Function
        /// </summary>
        public SecurityTraining()
        {
         Init();
        }
        /// <summary>
        /// Constructed Function
        /// </summary>
        /// <param name="dr">DataRow</param>
        public SecurityTraining(DataRow dr)
        {
        Init();
        SetModel(dr);
        }
        /// <summary>
        /// Constructed Function
        /// </summary>
        /// <param name="dt">DataTable</param>
        public SecurityTraining(DataTable dt)
        {
        Init();
        SetModel(dt);
        }
        #endregion --New--

        #region --Private--
        /// <summary>
        /// Init The Private variable
        /// </summary>
        private void Init()
         {
                 _recid=0;
                 _docid=string.Empty;
                 _year=0;
                 _item=string.Empty;
                 _trainingcontent=string.Empty;
                 _studymaterial=string.Empty;
                 _trainingresult=string.Empty;
                 _recdivid=string.Empty;
                 _recacct=string.Empty;
                 _recdate=DateTime.MinValue;
                 _void=false;
                 _voidacct=string.Empty;
                 _voiddate=DateTime.MinValue;
                 _useracct=string.Empty;
                 _lastupdatedate=DateTime.MinValue;
        }
        /// <summary>
        /// SetModel By DataRow
        /// </summary>
        /// <param name="dr">DataRow</param>
        /// <returns>SecurityTraining</returns>
        private SecurityTraining SetModel(DataRow dr)
        {
                 _recid=StrHelper.GetIntValue(dr[FIELD_RecID]);
                 _docid=StrHelper.GetStringValue(dr[FIELD_DocID]);
                 _year=StrHelper.GetIntValue(dr[FIELD_Year]);
                 _item=StrHelper.GetStringValue(dr[FIELD_Item]);
                 _trainingcontent=StrHelper.GetStringValue(dr[FIELD_TrainingContent]);
                 _studymaterial=StrHelper.GetStringValue(dr[FIELD_StudyMaterial]);
                 _trainingresult=StrHelper.GetStringValue(dr[FIELD_TrainingResult]);
                 _recdivid=StrHelper.GetStringValue(dr[FIELD_RecDivID]);
                 _recacct=StrHelper.GetStringValue(dr[FIELD_RecAcct]);
                 _recdate=StrHelper.GetDateTimeValue(dr[FIELD_RecDate]);
                 //_void=StrHelper.GetBoolValue(dr[FIELD_Void]);
                 //_voidacct=StrHelper.GetStringValue(dr[FIELD_VoidAcct]);
                 //_voiddate=StrHelper.GetDateTimeValue(dr[FIELD_VoidDate]);
                 _useracct=StrHelper.GetStringValue(dr[FIELD_UserAcct]);
                 _lastupdatedate=StrHelper.GetDateTimeValue(dr[FIELD_LastUpdateDate]);
                return this;
        }
        /// <summary>
        /// SetModel By DataTable
        /// </summary>
        /// <param name="dt">DataTable</param>
        /// <returns>SecurityTraining</returns>
        private SecurityTraining SetModel(DataTable dt)
        {
                foreach (DataRow dr in dt.Rows)
                {
                 SetModel(dr);
                break;
                }
                return this;
        }
        #endregion --Private--

    }
}

